package com.lzx.makeFriend.controller.web;

import com.lzx.common.utils.R;
import com.lzx.makeFriend.entity.Attention;
import com.lzx.makeFriend.service.AttentionService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/makeFriend/attention/web")
public class WebAttentionController {
    @Resource
    private AttentionService attentionService;

    //获取当前用户关注的人发表的问题
    @GetMapping("/getUserAttentionPublishProblem/{userId}")
    public R getUserAttentionPublishProblem(@PathVariable Long userId){
        return attentionService.getUserAttentionPublishProblem(userId);
    }

    //获取当前用户已关注的人
    @GetMapping("/getUserAttentionById/{userId}")
    public R getUserAttentionById(@PathVariable Long userId){
        return attentionService.getUserAttentionById(userId);
    }

    //关注其他人
    @PostMapping("/attention")
    public R attention(@RequestBody Attention attention){
        return attentionService.attention(attention);
    }
}
